package design.mode.model.factory.factorymethod.factory;

import design.mode.model.factory.factorymethod.factory.comon.CoffeeFactory;
import design.mode.model.factory.util.BeanUtils;

/**
 * @author ldanniel
 * @description 具体工厂类，负责实现创建所有产品的内部逻辑，该工厂类可以被直接调用，创建所需的具体对象
 * @since jdk11
 */
public class AmericanCoffeeFactory implements CoffeeFactory {

    @Override
    public <T> T createProduct(Class<T> clazz) {
        return BeanUtils.getBean(clazz);
    }
}
